﻿using System;
using System.Collections.Generic;
using netDxf;
using netDxf.Entities;
using netDxf.Tables;

namespace TestDxfDocument
{
    class Frame
    {
        public static Vector2 A0X = new Vector2(1189, 841);
        public static Vector2 A1X = new Vector2(841, 594);
        public static Vector2 A2X = new Vector2(594, 420);
        public static Vector2 A3X = new Vector2(420, 297);
        public static Vector2 A4X = new Vector2(297, 210);
        public static Vector2 A4Y = new Vector2(210, 297);

        public static Dictionary<string, Vector2> frameA0XP(Dictionary<string, Object> data)  //A0图纸X型 留装订边 参数化
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于7mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);

            string unitname;
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }

            string drawname ;
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }

            string drawnum;
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }

            string materialcode;
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 1189;  //图纸长度
            double b = 841;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            //string drawdesc = "cnmg";
            //string idofframe = "2313163";
            //string nameofframe = "2313163-1";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA1XP(Dictionary<string, Object> data)  //A1图纸X型 留装订边 参数化
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于5mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);
            string unitname = Convert.ToString(data["unitname"]);
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }
            string drawname = Convert.ToString(data["drawname"]);
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }
            string drawnum = "(图样代号)";
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }
            string materialcode = "(材料代号)";
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 841;  //图纸长度
            double b = 594;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            //string drawdesc = "cnmg";
            //string idofframe = "2313163";
            //string nameofframe = "2313163-1";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA2XP(Dictionary<string, Object> data)  //A2图纸X型 留装订边 参数化
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);
            string unitname = Convert.ToString(data["unitname"]);
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }
            string drawname = Convert.ToString(data["drawname"]);
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }
            string drawnum = "(图样代号)";
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }
            string materialcode = "(材料代号)";
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 594;  //图纸长度
            double b = 420;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            //string drawdesc = "cnmg";
            //string idofframe = "2313163";
            //string nameofframe = "2313163-1";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA3XP(Dictionary<string, Object> data)  //A3图纸X型 留装订边 参数化
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);
            string unitname = Convert.ToString(data["unitname"]);
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }
            string drawname = Convert.ToString(data["drawname"]);
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }
            string drawnum = "(图样代号)";
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }
            string materialcode = "(材料代号)";
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 420;  //图纸长度
            double b = 297;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            //string drawdesc = "cnmg";
            //string idofframe = "2313163";
            //string nameofframe = "2313163-1";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA4XP(Dictionary<string, Object> data)  //A4图纸X型 留装订边 参数化
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);
            string unitname = Convert.ToString(data["unitname"]);
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }
            string drawname = Convert.ToString(data["drawname"]);
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }
            string drawnum = "(图样代号)";
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }
            string materialcode = "(材料代号)";
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 297;  //图纸长度
            double b = 210;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            //string drawdesc = "cnmg";
            //string idofframe = "2313163";
            //string nameofframe = "2313163-1";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.5, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.7, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.5, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.5, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.5, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.5, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.5, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.5, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.5, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.5, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.5, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.5, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.5, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.5, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.5, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.5, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.5, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.5, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.5, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.5, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.5, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.5, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.5, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.5, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.5, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.5, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.5, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.5, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.5, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.5, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.5, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.5, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.5, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.5, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.5, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.5, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.5, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.5, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA4YP(Dictionary<string, Object> data)  //A4图纸Y型 留装订边 参数化
        {
            Vector2 p0 = new Vector2(0, 0);
            DxfDocument dxf = new DxfDocument();

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            string path = Convert.ToString(data["path"]);
            string unitname = Convert.ToString(data["unitname"]);
            try
            {
                unitname = Convert.ToString(data["unitname"]);
            }
            catch
            {
                unitname = "(单位名称)";
            }
            string drawname = Convert.ToString(data["drawname"]);
            try
            {
                drawname = Convert.ToString(data["drawname"]);
            }
            catch
            {
                drawname = "(图样名称)";
            }
            string drawnum = "(图样代号)";
            try
            {
                drawnum = Convert.ToString(data["drawnum"]);
            }
            catch
            {
                drawnum = "(图样代号)";
            }
            string materialcode = "(材料代号)";
            try
            {
                materialcode = Convert.ToString(data["materialcode"]);
            }
            catch
            {
                materialcode = "(材料代号)";
            }
            string drawdesc = Convert.ToString(data["drawdesc"]);
            string idofframe = Convert.ToString(data["idofframe"]);
            string nameofframe = Convert.ToString(data["nameofframe"]);

            double pi = Math.PI;
            double l = 297;  //图纸宽度
            double b = 210;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + a, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + a, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();

            fun.writetext(dxf, unitname, new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, materialcode, new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawname, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, drawnum, new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");

            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            dxf.DrawingVariables.AcadVer = netDxf.Header.DxfVersion.AutoCad2007;
            dxf.Save(path);
            return positions;
        }

        public static Dictionary<string, Vector2> frameA0X(DxfDocument dxf, Vector2 p0)  //A0图纸X型 留装订边
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于7mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;
            double l = 1189;  //图纸长度
            double b = 841;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA1X(DxfDocument dxf, Vector2 p0)  //A1图纸X型 留装订边
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于5mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;
            double l = 841;  //图纸长度
            double b = 594;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA2X(DxfDocument dxf, Vector2 p0)  //A2图纸X型 留装订边
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            
            double pi = Math.PI;
            double l = 594;  //图纸长度
            double b = 420;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA3X(DxfDocument dxf, Vector2 p0)  //A3图纸X型 留装订边
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            
            double pi = Math.PI;
            double l = 420;  //图纸长度
            double b = 297;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "校对", new Vector2((b17.X + b18.X) / 2.0, (b20.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA4X(DxfDocument dxf, Vector2 p0)  //A4图纸X型 留装订边
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            
            double pi = Math.PI;
            double l = 297;  //图纸长度
            double b = 210;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.5, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.7, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.5, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.5, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.5, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.5, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.5, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.5, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.5, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.5, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.5, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.5, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.5, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.5, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.5, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.5, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.5, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.5, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.5, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.5, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.5, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.5, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.5, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.5, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.5, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.5, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.5, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.5, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.5, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.5, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.5, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.5, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.5, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.5, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.5, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.5, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.5, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.5, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA0Y(DxfDocument dxf, Vector2 p0)  //A0图纸Y型 留装订边
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 1189;  //图纸宽度
            double b = 841;  //图纸长度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            //string drawdesc = Convert.ToString(data["drawdesc"]);
            //string idofframe = Convert.ToString(data["idofframe"]);
            //string nameofframe = Convert.ToString(data["nameofframe"]);

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA1Y(DxfDocument dxf, Vector2 p0)  //A1图纸Y型 留装订边
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 841;  //图纸宽度
            double b = 594;  //图纸长度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA2Y(DxfDocument dxf, Vector2 p0)  //A2图纸Y型 留装订边
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 594;  //图纸宽度
            double b = 420;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA3Y(DxfDocument dxf, Vector2 p0)  //A3图纸Y型 留装订边
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 420;  //图纸宽度
            double b = 297;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();
            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");


            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA4Y(DxfDocument dxf, Vector2 p0)  //A4图纸Y型 留装订边
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            
            double pi = Math.PI;
            double l = 297;  //图纸宽度
            double b = 210;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            string drawdesc = "";
            string idofframe = "";
            string nameofframe = "";

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + a, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + a, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, 0.15, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, 0.3, contour);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2p.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2p.X, p2p.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, 0.2, contour);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, 0.2, contour);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, 0.2, contour);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, 0.2, contour);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, 0.2, contour);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, 0.2, contour);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, 0.2, contour);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, 0.2, contour);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, 0.2, contour);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, 0.2, contour);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, 0.2, contour);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, 0.2, contour);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, 0.2, contour);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, 0.2, contour);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, 0.2, contour);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, 0.2, contour);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, 0.2, contour);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, 0.2, contour);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, 0.2, contour);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, 0.2, contour);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, 0.2, contour);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, 0.2, contour);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, 0.2, contour);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, 0.2, contour);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, 0.2, contour);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, 0.2, contour);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, 0.2, contour);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, 0.2, contour);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, 0.2, contour);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, contour);

            Vector2 b50 = new Vector2(p1p.X - 80, p1p.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1p.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, 0.2, contour);

            Vector2 b40 = new Vector2(p0p.X + 100, p0p.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0p.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0p.X + 40, p0p.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, 0.2, contour);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, 0.2, contour);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, 0.2, contour);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, 0.2, contour);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, 0.2, contour);

            TextStyle style = new TextStyle("simsun.ttf");
            Dictionary<string, Vector2> positions = new Dictionary<string, Vector2>();

            fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            positions.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");

            fun.writetext(dxf, drawdesc, new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, idofframe, new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            fun.writetext(dxf, nameofframe, new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");

            return positions;
        }

        public static Dictionary<string, Vector2> frameA0X(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A0图纸X型 留装订边 带品牌信息
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于7mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 1189;  //图纸长度
            double b = 841;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.4;  //线宽1
            double Lw2 = 0.6;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw1, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            List<Bom> bom = new List<Bom>();

            Bom(dxf, bom, b1, Lw2, contour);

            return mapsize;
        }

        public static Dictionary<string, Vector2> frameA1X(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A1图纸X型 留装订边 带品牌信息
        {
            ///最小线宽0.35；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于5mm，其他则是不小于5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 841;  //图纸长度
            double b = 594;  //图纸宽度
            double e = 20;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.4;  //线宽1
            double Lw2 = 0.6;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            List<Bom> bom = new List<Bom>();

            Bom(dxf, bom, b1, Lw2, contour);

            return mapsize;
        }

        public static Dictionary<string, Vector2> frameA2X(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A2图纸X型 留装订边 带品牌信息
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 594;  //图纸长度
            double b = 420;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 10;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4
            
            double Lw1 = 0.4;  //线宽1
            double Lw2 = 0.6;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            List<Bom> bom = new List<Bom>();

            Bom(dxf, bom, b1, Lw2, contour);

            return mapsize;
        }

        public static Dictionary<string, Vector2> frameA3X(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A3图纸X型 留装订边 带品牌信息
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 420;  //图纸长度
            double b = 297;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.7;  //线宽1
            double Lw2 = 1.0;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawPlineOfw(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawPlineOfw(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            //List<Bom> bom = new List<Bom>();

            //Bom bom1 = new Bom();
            //bom1.BomCode = "张朝兵";
            //bom1.BomMaterial = "张朝兵";
            //bom1.BomName = "张朝兵";
            //bom1.BomNote = "张朝兵";
            //bom1.BomNum = "张朝兵";
            //bom1.SingleWeight = "张朝兵";
            //bom1.TotalWeight = "张朝兵";
            //bom.Add(bom1);

            //Bom(dxf, bom, b1, Lw2, contour);

            return mapsize;
        }

        public static Dictionary<string, Vector2> frameA4X(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A4图纸X型 留装订边 带品牌信息
        {
            ///最小线宽0.25；平行线的间隙不小于较粗线宽的两倍，最小值不小于0.7；
            ///汉字高度不小于3.5mm，其他则是不小于3.5mm；汉字字距1.5mm，行距2mm，其他字符间距0.35/0.5mm，词距1.05/1.5mm，行距1mm
            ///

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 297;  //图纸长度
            double b = 210;  //图纸宽度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.4;  //线宽1
            double Lw2 = 0.6;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, l);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, b);
            Vector2 p3 = fun.Polar(p2, pi, l);
            Vector2 p0p = new Vector2(p0.X + e, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + e, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            List<Bom> bom = new List<Bom>();

            Bom(dxf, bom, b1, Lw2, contour);

            return mapsize;
        }

        public static Dictionary<string, Vector2> frameA4Y(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A4图纸Y型 留装订边 带品牌信息
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 297;  //图纸宽度
            double b = 210;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.4;  //线宽1
            double Lw2 = 0.6;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + a, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + a, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            return mapsize;
        }
        public static Dictionary<string, Vector2> frameA3Y(DxfDocument dxf, Vector2 p0, Dictionary<string, Object> data)  //A3图纸Y型 留装订边 带品牌信息
        {
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层

            double pi = Math.PI;

            double l = 420;  //图纸宽度
            double b = 297;  //图纸长度
            double e = 10;  //参考GB/T-14689表4
            double c = 5;  //参考GB/T-14689表4
            double a = 25;  //参考GB/T-14689表4

            double Lw1 = 0.7;  //线宽1
            double Lw2 = 1.0;  //线宽2

            Vector2 p1 = fun.Polar(p0, 0, b);
            Vector2 p2 = fun.Polar(p1, 1.5 * pi, l);
            Vector2 p3 = fun.Polar(p2, pi, b);
            Vector2 p0p = new Vector2(p0.X + a, p0.Y - c);
            Vector2 p1p = new Vector2(p1.X - c, p1.Y - c);
            Vector2 p2p = new Vector2(p2.X - c, p2.Y + c);
            Vector2 p3p = new Vector2(p3.X + a, p3.Y + c);

            Vector2[] frame1 = { p0, p1, p2, p3, p0 };
            fun.drawBLine(dxf, frame1, Lw1, contour);
            Vector2[] frame2 = { p0p, p1p, p2p, p3p, p0p };
            fun.drawBLine(dxf, frame2, Lw2, contour);

            Dictionary<string, Vector2> mapsize = FramePiece(dxf, p0p, p1p, p2p, contour, data);

            Vector2 b1 = new Vector2(p2p.X - 180, p2p.Y + 56);

            return mapsize;
        }

        private static void Bom(DxfDocument dxf, List<Bom> bom,Vector2 p1,double Lw, netDxf.Tables.Layer layercolor)
        {
            //int bomcount = bom.Count+1;
            int bomcount = 1;
            if (bomcount == 1)
            {
                bomcount = 2;
            }

            Vector2 b101 = new Vector2(p1.X, p1.Y);
            Vector2 b102 = new Vector2(b101.X + 8, b101.Y);
            Vector2 b103 = new Vector2(b102.X + 40, b101.Y);
            Vector2 b104 = new Vector2(b103.X + 44, b101.Y);
            Vector2 b105 = new Vector2(b104.X + 8, b101.Y);
            Vector2 b106 = new Vector2(b105.X + 38, b101.Y);
            Vector2 b107 = new Vector2(b106.X + 22, b101.Y);
            Vector2 b108 = new Vector2(p1.X + 180, p1.Y);
            Vector2 b109 = new Vector2(b106.X, b106.Y + 7);
            Vector2 b110 = new Vector2(b109.X + 10, b109.Y);
            Vector2 b111 = new Vector2(b110.X + 12, b109.Y);

            Vector2[] bm = new Vector2[bomcount];
            Vector2[] bo = new Vector2[bomcount];
            Vector2[] bc = new Vector2[bomcount];
            Vector2[] bn = new Vector2[bomcount];
            Vector2[] bnum = new Vector2[bomcount];
            Vector2[] bma = new Vector2[bomcount];
            Vector2[] bs = new Vector2[bomcount];
            Vector2[] bt = new Vector2[bomcount];
            Vector2[] bnote = new Vector2[bomcount];

            bm[0] = new Vector2(b101.X, b101.Y + 14);
            bo[0] = new Vector2(bm[0].X + 8, bm[0].Y);
            bc[0] = new Vector2(bo[0].X + 40, bm[0].Y);
            bn[0] = new Vector2(bc[0].X + 44, bm[0].Y);
            bnum[0] = new Vector2(bn[0].X + 8, bm[0].Y);
            bma[0] = new Vector2(bnum[0].X + 38, bm[0].Y);
            bs[0] = new Vector2(bma[0].X + 10, bm[0].Y);
            bt[0] = new Vector2(bs[0].X + 12, bm[0].Y);
            bnote[0] = new Vector2(bt[0].X + 20, bm[0].Y);

            Vector2[] mxline1 = { b101, bm[0], bnote[0], b108 };
            fun.drawPlineOfw(dxf, mxline1, Lw, layercolor);
            Vector2[] mxline2 = { b102, bo[0] };
            fun.drawPlineOfw(dxf, mxline2, Lw, layercolor);
            Vector2[] mxline3 = { b103, bc[0] };
            fun.drawPlineOfw(dxf, mxline3, Lw, layercolor);
            Vector2[] mxline4 = { b104, bn[0] };
            fun.drawPlineOfw(dxf, mxline4, Lw, layercolor);
            Vector2[] mxline5 = { b105, bnum[0] };
            fun.drawPlineOfw(dxf, mxline5, Lw, layercolor);
            Vector2[] mxline6 = { b106, bma[0] };
            fun.drawPlineOfw(dxf, mxline6, Lw, layercolor);
            Vector2[] mxline7 = { b110, bs[0] };
            fun.drawPlineOfw(dxf, mxline7, Lw, layercolor);
            Vector2[] mxline8 = { b107, bt[0] };
            fun.drawPlineOfw(dxf, mxline8, Lw, layercolor);
            Vector2[] mxline9 = { b108, bnote[0] };
            fun.drawPlineOfw(dxf, mxline9, Lw, layercolor);
            Vector2[] mxline10 = { b109, b110, b111 };
            fun.drawPlineOfw(dxf, mxline10, Lw, layercolor);

            for (int i = 1; i < bomcount; i++)
            {
                bm[i] = new Vector2(bm[i - 1].X, bm[i - 1].Y + 7);
                bo[i] = new Vector2(bo[i - 1].X, bo[i - 1].Y + 7);
                bc[i] = new Vector2(bc[i - 1].X, bc[i - 1].Y + 7);
                bn[i] = new Vector2(bn[i - 1].X, bn[i - 1].Y + 7);
                bnum[i] = new Vector2(bnum[i - 1].X, bnum[i - 1].Y + 7);
                bma[i] = new Vector2(bma[i - 1].X, bma[i - 1].Y + 7);
                bs[i] = new Vector2(bs[i - 1].X, bs[i - 1].Y + 7);
                bt[i] = new Vector2(bt[i - 1].X, bt[i - 1].Y + 7);
                bnote[i] = new Vector2(bnote[i - 1].X, bnote[i - 1].Y + 7);

                Vector2[] mxlinem1 = { bm[i - 1], bm[i], bnote[i], bnote[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem1, Lw, layercolor);
                Vector2[] mxlinem2 = { bo[i], bo[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem2, Lw, layercolor);
                Vector2[] mxlinem3 = { bc[i], bc[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem3, Lw, layercolor);
                Vector2[] mxlinem4 = { bn[i], bn[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem4, Lw, layercolor);
                Vector2[] mxlinem5 = { bnum[i], bnum[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem5, Lw, layercolor);
                Vector2[] mxlinem6 = { bma[i], bma[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem6, Lw, layercolor);
                Vector2[] mxlinem7 = { bs[i], bs[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem7, Lw, layercolor);
                Vector2[] mxlinem8 = { bt[i], bt[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem8, Lw, layercolor);
                Vector2[] mxlinem9 = { bnote[i], bnote[i - 1] };
                fun.drawPlineOfw(dxf, mxlinem9, Lw, layercolor);

            }


            TextStyle style = new TextStyle("simsun.ttf");
            MText mtext1 = new MText("序\\P号", new Vector2(p1.X + 2, bm[0].Y - 2.7), 3.0, 0, style);
            mtext1.Layer = new Layer("text");
            mtext1.Layer.Color.Index = 8;
            dxf.AddEntity(new EntityObject[] { mtext1 });

            MText mtext2 = new MText("数\\P量", new Vector2(bn[0].X + 2, bm[0].Y - 2.7), 3.0, 0, style);
            mtext2.Layer = new Layer("text");
            mtext2.Layer.Color.Index = 8;
            dxf.AddEntity(new EntityObject[] { mtext2 });

            fun.writetext(dxf, "代        号", new Vector2((b102.X + b103.X) / 2.0, (b102.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "名        称", new Vector2((b103.X + b104.X) / 2.0, (b102.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "材        料", new Vector2((b105.X + b106.X) / 2.0, (b102.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "重   量", new Vector2((b106.X + b107.X) / 2.0, (b102.Y + b109.Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "单件", new Vector2((b109.X + b110.X) / 2.0, (b109.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "总计", new Vector2((b110.X + b111.X) / 2.0, (b109.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            fun.writetext(dxf, "备    注", new Vector2((b107.X + b108.X) / 2.0, (b102.Y + bm[0].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");

            for (int i = 0; i < bom.Count; i++)
            {
                fun.writetext(dxf, i + 1 + " ", new Vector2((b101.X + b102.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].BomCode, new Vector2((b102.X + b103.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].BomName, new Vector2((b103.X + b104.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].BomNum, new Vector2((b104.X + b105.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].BomMaterial, new Vector2((b105.X + b106.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].SingleWeight, new Vector2((b109.X + b110.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].TotalWeight, new Vector2((b110.X + b111.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
                fun.writetext(dxf, bom[i].BomNote, new Vector2((b107.X + b108.X) / 2.0, (bm[i].Y + bm[i + 1].Y) / 2.0 + 1.5), 3.0, 0, 0.8, "C");
            }
        }

        private static Dictionary<string, Vector2> FramePiece(DxfDocument dxf, Vector2 p0, Vector2 p1, Vector2 p2, netDxf.Tables.Layer layercolor, Dictionary<string, Object> data)
        {

            Dictionary<string, Vector2> mapsize = new Dictionary<string, Vector2>();

            double Lw2 = 0.6;  //线宽2

            Vector2 b1 = new Vector2(p2.X - 180, p2.Y + 56);
            Vector2 b2 = new Vector2(b1.X + 10, b1.Y);
            Vector2 b3 = new Vector2(b2.X + 10, b1.Y);
            Vector2 b4 = new Vector2(b3.X + 16, b1.Y);
            Vector2 b5 = new Vector2(b4.X + 16, b1.Y);
            Vector2 b6 = new Vector2(b5.X + 12, b1.Y);
            Vector2 b7 = new Vector2(b6.X + 16, b1.Y);

            Vector2 b8 = new Vector2(p2.X, b1.Y);
            Vector2 b9 = new Vector2(b8.X, b8.Y - 17);
            Vector2 b10 = new Vector2(b8.X, b9.Y - 18);
            Vector2 b11 = new Vector2(p2.X, p2.Y);

            Vector2 b12 = new Vector2(b11.X - 100, b11.Y);
            Vector2 b13 = new Vector2(b12.X - 16, b11.Y);
            Vector2 b14 = new Vector2(b13.X - 12, b11.Y);
            Vector2 b15 = new Vector2(b14.X - 12, b11.Y);
            Vector2 b16 = new Vector2(b15.X - 16, b11.Y);
            Vector2 b17 = new Vector2(b16.X - 12, b11.Y);
            Vector2 b18 = new Vector2(b17.X - 12, b11.Y);
            Vector2 b19 = new Vector2(b18.X, b18.Y + 7);
            Vector2 b20 = new Vector2(b18.X, b19.Y + 7);
            Vector2 b21 = new Vector2(b18.X, b20.Y + 7);
            Vector2 b22 = new Vector2(b18.X, b21.Y + 7);
            Vector2 b23 = new Vector2(b18.X, b22.Y + 7);
            Vector2 b24 = new Vector2(b18.X, b23.Y + 7);
            Vector2 b25 = new Vector2(b18.X, b24.Y + 7);
            Vector2 b2p = new Vector2(b2.X, b22.Y);
            Vector2 b3p = new Vector2(b3.X, b22.Y);
            Vector2 b4p = new Vector2(b4.X, b22.Y);
            Vector2 b5p = new Vector2(b5.X, b22.Y);
            Vector2 b6p = new Vector2(b6.X, b22.Y);
            Vector2 b9p = new Vector2(b7.X + 50, b9.Y);
            Vector2 b10p = new Vector2(b7.X + 50, b10.Y);
            Vector2 b13p = new Vector2(b13.X, b22.Y);
            Vector2 b14p = new Vector2(b14.X, b22.Y);
            Vector2 b15p = new Vector2(b15.X, b22.Y);
            Vector2 b16p = new Vector2(b16.X, b22.Y);
            Vector2 b17p = new Vector2(b17.X, b22.Y);
            Vector2 b19p = new Vector2(b7.X, b19.Y);
            Vector2 b20p = new Vector2(b7.X, b20.Y);
            Vector2 b21p = new Vector2(b7.X, b21.Y);
            Vector2 b22p = new Vector2(b7.X, b22.Y);
            Vector2 b23p = new Vector2(b7.X, b23.Y);
            Vector2 b24p = new Vector2(b7.X, b24.Y);
            Vector2 b25p = new Vector2(b7.X, b25.Y);

            Vector2 b7b = new Vector2(b7.X + 50, b1.Y);
            Vector2 b12b = new Vector2(b7b.X, b11.Y);
            Vector2 b30 = new Vector2(b7.X, b12.Y + 9);
            Vector2 b31 = new Vector2(b7.X, b30.Y + 9);
            Vector2 b32 = new Vector2(b7.X, b31.Y + 10);
            Vector2 b30b = new Vector2(b7b.X, b30.Y);
            Vector2 b31b = new Vector2(b7b.X, b31.Y);
            Vector2 b32b = new Vector2(b7b.X, b32.Y);
            Vector2 b33 = new Vector2(b31.X + 6.5, b31.Y);
            Vector2 b34 = new Vector2(b33.X + 6.5, b31.Y);
            Vector2 b35 = new Vector2(b34.X + 6.5, b31.Y);
            Vector2 b36 = new Vector2(b35.X + 6.5, b32.Y);
            Vector2 b37 = new Vector2(b36.X + 12, b32.Y);
            Vector2 b33b = new Vector2(b33.X, b30.Y);
            Vector2 b34b = new Vector2(b34.X, b30.Y);
            Vector2 b35b = new Vector2(b35.X, b30.Y);
            Vector2 b36b = new Vector2(b36.X, b30.Y);
            Vector2 b37b = new Vector2(b37.X, b30.Y);


            Vector2[] bline1 = { b8, b1, b18 };
            fun.drawPlineOfw(dxf, bline1, Lw2, layercolor);
            Vector2[] bline2 = { b2, b2p };
            fun.drawPlineOfw(dxf, bline2, Lw2, layercolor);
            Vector2[] bline3 = { b3, b3p };
            fun.drawPlineOfw(dxf, bline3, Lw2, layercolor);
            Vector2[] bline4 = { b4, b4p };
            fun.drawPlineOfw(dxf, bline4, Lw2, layercolor);
            Vector2[] bline5 = { b5, b5p };
            fun.drawPlineOfw(dxf, bline5, Lw2, layercolor);
            Vector2[] bline6 = { b6, b6p };
            fun.drawPlineOfw(dxf, bline6, Lw2, layercolor);
            Vector2[] bline7 = { b7, b12 };
            fun.drawPlineOfw(dxf, bline7, Lw2, layercolor);
            Vector2[] bline8 = { b9, b9p };
            fun.drawPlineOfw(dxf, bline8, Lw2, layercolor);
            Vector2[] bline9 = { b10, b10p };
            fun.drawPlineOfw(dxf, bline9, Lw2, layercolor);
            Vector2[] bline10 = { b13, b13p };
            fun.drawPlineOfw(dxf, bline10, Lw2, layercolor);
            Vector2[] bline11 = { b14, b14p };
            fun.drawPlineOfw(dxf, bline11, Lw2, layercolor);
            Vector2[] bline12 = { b15, b15p };
            fun.drawPlineOfw(dxf, bline12, Lw2, layercolor);
            Vector2[] bline13 = { b16, b16p };
            fun.drawPlineOfw(dxf, bline13, Lw2, layercolor);
            Vector2[] bline14 = { b17, b17p };
            fun.drawPlineOfw(dxf, bline14, Lw2, layercolor);
            Vector2[] bline15 = { b19, b19p };
            fun.drawPlineOfw(dxf, bline15, Lw2, layercolor);
            Vector2[] bline16 = { b20, b20p };
            fun.drawPlineOfw(dxf, bline16, Lw2, layercolor);
            Vector2[] bline17 = { b21, b21p };
            fun.drawPlineOfw(dxf, bline17, Lw2, layercolor);
            Vector2[] bline18 = { b22, b22p };
            fun.drawPlineOfw(dxf, bline18, Lw2, layercolor);
            Vector2[] bline19 = { b23, b23p };
            fun.drawPlineOfw(dxf, bline19, Lw2, layercolor);
            Vector2[] bline20 = { b24, b24p };
            fun.drawPlineOfw(dxf, bline20, Lw2, layercolor);
            Vector2[] bline21 = { b25, b25p };
            fun.drawPlineOfw(dxf, bline21, Lw2, layercolor);

            Vector2[] blineb1 = { b7b, b12b };
            fun.drawPlineOfw(dxf, blineb1, Lw2, layercolor);
            Vector2[] blineb2 = { b30, b30b };
            fun.drawPlineOfw(dxf, blineb2, Lw2, layercolor);
            Vector2[] blineb3 = { b31, b31b };
            fun.drawPlineOfw(dxf, blineb3, Lw2, layercolor);
            Vector2[] blineb4 = { b32, b32b };
            fun.drawPlineOfw(dxf, blineb4, Lw2, layercolor);
            Vector2[] blineb5 = { b33, b33b };
            fun.drawPlineOfw(dxf, blineb5, Lw2, layercolor);
            Vector2[] blineb6 = { b34, b34b };
            fun.drawPlineOfw(dxf, blineb6, Lw2, layercolor);
            Vector2[] blineb7 = { b35, b35b };
            fun.drawPlineOfw(dxf, blineb7, Lw2, layercolor);
            Vector2[] blineb8 = { b36, b36b };
            fun.drawPlineOfw(dxf, blineb8, Lw2, layercolor);
            Vector2[] blineb9 = { b37, b37b };
            fun.drawPlineOfw(dxf, blineb9, 0.2, layercolor);

            Vector2 b50 = new Vector2(p1.X - 80, p1.Y);
            Vector2 b51 = new Vector2(b50.X, b50.Y - 45);
            Vector2 b52 = new Vector2(p1.X, b51.Y);

            Vector2[] bline22 = { b50, b51, b52 };
            fun.drawPlineOfw(dxf, bline22, Lw2, layercolor);

            Vector2 b40 = new Vector2(p0.X + 100, p0.Y);
            Vector2 b41 = new Vector2(b40.X, b40.Y - 10);
            Vector2 b42 = new Vector2(b40.X, b41.Y - 10);
            Vector2 b43 = new Vector2(b40.X, b42.Y - 10);
            Vector2 b44 = new Vector2(b40.X, b43.Y - 15);
            Vector2 b45 = new Vector2(p0.X, b44.Y);
            Vector2 b46 = new Vector2(b45.X, b43.Y);
            Vector2 b47 = new Vector2(p0.X + 40, p0.Y);
            Vector2 b41p = new Vector2(b47.X, b41.Y);
            Vector2 b42p = new Vector2(b47.X, b42.Y);
            Vector2 b43p = new Vector2(b47.X, b43.Y);

            Vector2[] bline23 = { b40, b44, b45 };
            fun.drawPlineOfw(dxf, bline23, Lw2, layercolor);
            Vector2[] bline24 = { b43, b46 };
            fun.drawPlineOfw(dxf, bline24, Lw2, layercolor);
            Vector2[] bline25 = { b47, b43p };
            fun.drawPlineOfw(dxf, bline25, Lw2, layercolor);
            Vector2[] bline26 = { b41, b41p };
            fun.drawPlineOfw(dxf, bline26, Lw2, layercolor);
            Vector2[] bline27 = { b42, b42p };
            fun.drawPlineOfw(dxf, bline27, Lw2, layercolor);

            List<Bom> bom = new List<Bom>();

            TextStyle style = new TextStyle("simsun.ttf");
            //fun.writetext(dxf, "伊高智能平台", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            
            try
            {
                fun.writetext(dxf, Convert.ToString(data["unitname"]), new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            catch
            {
                fun.writetext(dxf, "(单位名称)", new Vector2((b7b.X + b8.X) / 2.0, (b8.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            
            try
            {
                fun.writetext(dxf, Convert.ToString(data["drawname"]), new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            catch
            {
                fun.writetext(dxf, "(图样名称)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b9.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            try
            {
                fun.writetext(dxf, Convert.ToString(data["drawnum"]), new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            catch
            {
                fun.writetext(dxf, "(图样代号)", new Vector2((b7b.X + b8.X) / 2.0, (b10.Y + b11.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            }
            try
            {
                fun.writetext(dxf, Convert.ToString(data["materialcode"]), new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            }
            catch
            {
                fun.writetext(dxf, "(材料标记)", new Vector2((b32.X + b7b.X) / 2.0, (b8.Y + b23.Y) / 2.0 - 1.75), 3.5, 0, 0.6, "C");
            }

            fun.writetext(dxf, "阶段标记", new Vector2((b32.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "重量", new Vector2((b37.X + b36.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b32.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            mapsize.Add("比例", new Vector2((b37.X + b7b.X) / 2.0, (b31b.Y + b30.Y) / 2.0 + 1.75));
            fun.writetext(dxf, "共  张   第  张", new Vector2((b12.X + b12b.X) / 2.0, (b12b.Y + b30.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标记", new Vector2((b1.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "处数", new Vector2((b3.X + b2.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "分区", new Vector2((b3.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "更改文件号", new Vector2((b5.X + b4.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "签名", new Vector2((b5.X + b6.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "年、月、日", new Vector2((b6.X + b7.X) / 2.0, (b22.Y + b23.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "设计", new Vector2((b17.X + b18.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "标准化", new Vector2((b14.X + b15.X) / 2.0, (b22.Y + b21.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "审核", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b20.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");
            fun.writetext(dxf, "工艺", new Vector2((b17.X + b18.X) / 2.0, (b19.Y + b18.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "C");

            fun.writetext(dxf, "图描述", new Vector2(b47.X + 1, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "ID", new Vector2(b47.X + 1, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");
            fun.writetext(dxf, "name", new Vector2(b47.X + 1, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.6, "L");

            try
            {
                fun.writetext(dxf, Convert.ToString(data["drawdesc"]), new Vector2(b47.X + 15, (b40.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            }
            catch
            {

            }
            try
            {
                fun.writetext(dxf, Convert.ToString(data["idofframe"]), new Vector2(b47.X + 15, (b42.Y + b41.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            }
            catch
            {

            }
            try
            {
                fun.writetext(dxf, Convert.ToString(data["nameofframe"]), new Vector2(b47.X + 15, (b42.Y + b43.Y) / 2.0 + 1.75), 3.5, 0, 0.5, "L");
            }
            catch
            {

            }

            try
            {
                fun.writetext(dxf, "技术要求", new Vector2((b50.X + b52.X) / 2.0, b50.Y - 2.25), 3.5, 0, 0.6, "C");
                MText mtext = new MText(Convert.ToString(data["tecreq"]), new Vector3(b50.X + 3, b50.Y - 7.25, 0), 3.5, 0, style);
                mtext.Layer = new Layer("text");
                mtext.Layer.Color.Index = 8;
                dxf.AddEntity(new EntityObject[] { mtext });
            }
            catch
            {

            }

            //Bom(dxf, bom, b1, Lw2, layercolor);

            return mapsize;
        }
        public static void YNframeA4(DxfDocument dxf, Vector2 v1, double scale, string sjqm, string shqm, string xdqm, string sjrq, string shrq, string xdrq, string cdes, string des, string lh, string bmc, string coatn, string cnsc, string bbh, string jstj)
        {

            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            var pi = Math.PI;

            var v2 = fun.Polar(v1, 0, 210);
            var v3 = fun.Polar(v2, -90 * pi / 180, 297);
            var v4 = fun.Polar(v1, -90 * pi / 180, 297);
            var v5 = fun.Polar(v1, -90 * pi / 180, 284);
            var v6 = fun.Polar(v5, 0, 205);
            var v7 = fun.Polar(v6, 90 * pi / 180, 279);
            var v8 = fun.Polar(v7, pi, 180);
            var v9 = new Vector2(v8.X, v5.Y);
            var v10 = fun.Polar(v6, 90 * pi / 180, 30);
            var v11 = new Vector2(v9.X, v10.Y);
            var v12 = fun.Polar(v9, 90 * pi / 180, 7.5);
            var v13 = new Vector2(v7.X, v12.Y);
            var v14 = fun.Polar(v9, 0, 37);
            var v15 = new Vector2(v14.X, v10.Y);
            var v16 = fun.Polar(v12, 90 * pi / 180, 22.5 / 4);
            var v17 = new Vector2(v14.X, v16.Y);
            var v18 = fun.Polar(v16, 90 * pi / 180, 22.5 / 4);
            var v19 = new Vector2(v14.X, v18.Y);
            var v20 = fun.Polar(v18, 90 * pi / 180, 22.5 / 4);
            var v21 = new Vector2(v14.X, v20.Y);
            var v22 = fun.Polar(v15, pi, 14.25);
            var v23 = new Vector2(v22.X, v12.Y);
            var v24 = fun.Polar(v22, pi, fun.CalDistance(v11, v22) / 2);
            var v25 = new Vector2(v24.X, v12.Y);
            var v26 = fun.Polar(v15, 0, 14.25);
            var v27 = new Vector2(v26.X, v14.Y);
            var v29 = fun.Polar(v27, 0, 18);
            var v28 = new Vector2(v29.X, v23.Y);
            var v30 = fun.Polar(v28, 0, 14);
            var v31 = new Vector2(v30.X, v29.Y);
            var v32 = fun.Polar(v30, 0, 18);
            var v33 = new Vector2(v32.X, v31.Y);
            var v34 = fun.Polar(v32, 0, 14);
            var v35 = new Vector2(v34.X, v33.Y);
            var v37 = fun.Polar(v35, 0, 12.25);
            var v36 = new Vector2(v37.X, v26.Y);
            var v38 = fun.Polar(v14, 90 * pi / 180, 15);
            var v39 = new Vector2(v37.X, v38.Y);
            var v40 = fun.Polar(v38, 90 * pi / 180, 7.5);
            var v41 = new Vector2(v36.X, v40.Y);
            var v42 = fun.Polar(v5, 90 * pi / 180, 9.8);
            var v43 = new Vector2(v9.X, v42.Y);
            var v44 = fun.Polar(v5, 90 * pi / 180, 14);
            var v45 = new Vector2(v9.X, v44.Y);
            var v46 = fun.Polar(v44, 0, fun.CalDistance(v44, v45) / 2);
            var v47 = new Vector2(v46.X, v5.Y);
            var v48 = fun.Polar(v5, 90 * pi / 180, 23.6);
            var v49 = new Vector2(v9.X, v48.Y);
            var v50 = fun.Polar(v48, 90 * pi / 180, 4.15);
            var v51 = new Vector2(v9.X, v50.Y);
            var v52 = fun.Polar(v50, 90 * pi / 180, fun.CalDistance(v48, v44));
            var v53 = new Vector2(v9.X, v52.Y);
            var v54 = fun.Polar(v52, 90 * pi / 180, fun.CalDistance(v50, v48));
            var v55 = new Vector2(v9.X, v54.Y);
            var v56 = fun.Polar(v54, 90 * pi / 180, fun.CalDistance(v48, v44));
            var v57 = new Vector2(v9.X, v56.Y);
            var v58 = fun.Polar(v56, 90 * pi / 180, fun.CalDistance(v50, v48));
            var v59 = new Vector2(v9.X, v58.Y);
            var v60 = fun.Polar(v7, pi, 32);
            var v61 = fun.Polar(v60, -90 * pi / 180, 7.6);
            var v62 = new Vector2(v7.X, v61.Y);


            var polyline1 = Pus.AddPointsToLwPolyLine(v1, v2, v3, v4, v1);
            var polyline2 = Pus.AddPointsToLwPolyLine(v5, v6, v7, v8, v9);
            var polyline3 = Pus.AddPointsToLwPolyLine(v60, v61, v62);
            var line1 = new Line(v10, v11);
            var line2 = new Line(v12, v13);
            var line3 = new Line(v14, v15);
            var line4 = new Line(v16, v17);
            var line5 = new Line(v18, v19);
            var line6 = new Line(v20, v21);
            var line7 = new Line(v22, v23);
            var line8 = new Line(v24, v25);
            var line9 = new Line(v26, v27);
            var line10 = new Line(v28, v29);
            var line11 = new Line(v30, v31);
            var line12 = new Line(v32, v33);
            var line13 = new Line(v34, v35);
            var line14 = new Line(v36, v37);
            var line15 = new Line(v38, v39);
            var line16 = new Line(v40, v41);
            var line17 = new Line(v42, v43);
            var line18 = new Line(v44, v45);
            var line19 = new Line(v46, v47);
            var line20 = new Line(v49, v48);
            var line21 = new Line(v50, v51);
            var line22 = new Line(v53, v52);
            var line23 = new Line(v54, v55);
            var line24 = new Line(v57, v56);
            var line25 = new Line(v58, v59);
            //dxf.AddEntity(new EntityObject[] { polyline1, polyline2, polyline3 , line1, line2, line3, line4, line5, line6, line7, line8, line9, line10, line11, line12, line13, line14, line15, line16, line17, line18, line19, line20, line21, line22, line23, line24, line25 });
            fun.PolyFill(dxf, polyline1, 0.2, contour);
            fun.PolyFill(dxf, polyline2, 0.2, contour);
            fun.PolyFill(dxf, polyline3, 0.2, contour);
            fun.drawBline(dxf, line1, 0.2, contour);
            fun.drawBline(dxf, line2, 0.2, contour);
            fun.drawBline(dxf, line3, 0.2, contour);
            fun.drawBline(dxf, line4, 0.2, contour);
            fun.drawBline(dxf, line5, 0.2, contour);
            fun.drawBline(dxf, line6, 0.2, contour);
            fun.drawBline(dxf, line7, 0.2, contour);
            fun.drawBline(dxf, line8, 0.2, contour);
            fun.drawBline(dxf, line9, 0.2, contour);
            fun.drawBline(dxf, line10, 0.2, contour);
            fun.drawBline(dxf, line11, 0.2, contour);
            fun.drawBline(dxf, line12, 0.2, contour);
            fun.drawBline(dxf, line13, 0.2, contour);
            fun.drawBline(dxf, line14, 0.2, contour);
            fun.drawBline(dxf, line15, 0.2, contour);
            fun.drawBline(dxf, line16, 0.2, contour);
            fun.drawBline(dxf, line17, 0.2, contour);
            fun.drawBline(dxf, line18, 0.2, contour);
            fun.drawBline(dxf, line19, 0.2, contour);
            fun.drawBline(dxf, line20, 0.2, contour);
            fun.drawBline(dxf, line21, 0.2, contour);
            fun.drawBline(dxf, line22, 0.2, contour);
            fun.drawBline(dxf, line23, 0.2, contour);
            fun.drawBline(dxf, line24, 0.2, contour);
            fun.drawBline(dxf, line25, 0.2, contour);

            fun.text(dxf, new Vector2(v56.X + 4, v56.Y + 0.5), 3, "图    幅");
            fun.text(dxf, new Vector2(v54.X + 10, v54.Y + 3.5), 3, "A4");
            fun.text(dxf, new Vector2(v52.X + 1, v52.Y + 0.5), 3, "旧 底 图 号");
            fun.text(dxf, new Vector2(v48.X + 1, v48.Y + 0.5), 3, "底 图 总 号");
            fun.text(dxf, new Vector2(v42.X + 1, v42.Y + 0.5), 3, "日 期");
            fun.text(dxf, new Vector2(v46.X + 1, v42.Y + 0.5), 3, "签 字");
            fun.text(dxf, new Vector2(v18.X + 1.5, v18.Y + 1.5), 2.5, "设 计");
            fun.text(dxf, new Vector2(v16.X + 1.5, v16.Y + 1.5), 2.5, "审 核");
            fun.text(dxf, new Vector2(v12.X + 1.5, v12.Y + 1.5), 2.5, "校 对");
            fun.text(dxf, new Vector2(v24.X + 1.5, v20.Y + 1.5), 2.5, "签 名");
            fun.text(dxf, new Vector2(v22.X + 2.5, v20.Y + 1.5), 2.5, "日 期");
            fun.text(dxf, new Vector2(v9.X + 6.5, v9.Y + 2.5), 2.5, "比 例    " + scale + ":1");
            fun.text(dxf, new Vector2(v40.X + 2.5, v40.Y + 2.5), 2.5, "名 称");
            fun.text(dxf, new Vector2(v38.X, v38.Y + 2.5), 2.5, "规格型号");
            fun.text(dxf, new Vector2(v38.X + 2.5, v23.Y + 2.5), 2.5, "料 号");
            fun.text(dxf, new Vector2(v14.X + 2.5, v14.Y + 2.5), 2.5, "材 料");
            fun.text(dxf, new Vector2(v29.X + 2.5, v29.Y + 2.5), 2.5, "涂 层");
            fun.text(dxf, new Vector2(v33.X + 2, v33.Y + 2.5), 2.5, "冷却孔");
            var v63 = fun.Polar(v22, 90 * pi / 180, 25.25);
            var v64 = fun.Polar(v63, 0, 28.5);
            var v65 = fun.Polar(v22, 90 * pi / 180, 18.25);
            var v66 = fun.Polar(v65, 0, 28.5);
            var v67 = fun.Polar(v22, 90 * pi / 180, 11.25);
            var v68 = fun.Polar(v67, 0, 28.5);

            var line26 = new Line(v63, v64);
            dxf.AddEntity(line26);
            var line27 = new Line(v65, v66);
            dxf.AddEntity(line27);
            var line28 = new Line(v67, v68);
            dxf.AddEntity(line28);

            fun.text(dxf, new Vector2(v63.X - 11, v63.Y), 2.5, "客户名");
            fun.text(dxf, new Vector2(v65.X - 10, v65.Y), 2.5, "确 认");
            fun.text(dxf, new Vector2(v67.X - 10, v67.Y), 2.5, "日 期");

           


            fun.text(dxf, new Vector2(v24.X + 0.5, v18.Y + 1.5), 2.5, sjqm);
            fun.text(dxf, new Vector2(v24.X + 0.5, v16.Y + 1.5), 2.5, shqm);
            fun.text(dxf, new Vector2(v24.X + 0.5, v12.Y + 1.5), 2.5, xdqm);
            fun.text(dxf, new Vector2(v22.X, v18.Y + 1.5), 2, sjrq);
            fun.text(dxf, new Vector2(v22.X, v16.Y + 1.5), 2, shrq);
            fun.text(dxf, new Vector2(v22.X, v12.Y + 1.5), 2, xdrq);
            fun.text(dxf, new Vector2(v26.X + 11, v40.Y + 2), 3, cdes);
            fun.text(dxf, new Vector2(v26.X + 11, v38.Y + 2), 3, des);
            fun.text(dxf, new Vector2(v26.X + 21, v23.Y + 2), 3, lh);
            fun.text(dxf, new Vector2(v61.X + 6, v61.Y + 2), 4, lh);
            fun.text(dxf, new Vector2(v26.X + 6.5, v14.Y + 2), 3, bmc);
            fun.text(dxf, new Vector2(v30.X + 5.5, v14.Y + 2), 3, coatn);
            fun.text(dxf, new Vector2(v34.X + 3.5, v14.Y + 2), 3, cnsc);
            fun.text(dxf, new Vector2(v37.X + 13, v37.Y + 2.5), 2.5, "版本号    " + bbh + "");

            if (!jstj.Equals("")) 
            {
                var a1p = fun.Polar(v26, 0, 48);
                var a2p = fun.Polar(a1p, 90 * pi / 180, 54);
                var a3p = new Vector2(v10.X, a2p.Y);

                fun.mtext(dxf, new Vector2(a2p.X + 20, a2p.Y - 1.5), 4, "技术条件");

                fun.mtext(dxf, new Vector2(a2p.X + -17, a2p.Y - 6), 3, jstj.Replace("\n", "\\N"));
            }

        }
    }

    class Bom    //明细栏
    {
        string bomCode;  //明细栏代号
        string bomName;  //
        string bomNum;
        string bomMaterial;
        string singleWeight;
        string totalWeight;
        string bomNote;

        public string BomCode
        {
            get { return bomCode; }
            set { bomCode = value; }
        }
        public string BomName
        {
            get { return bomName; }
            set { bomName = value; }
        }
        public string BomNum
        {
            get { return bomNum; }
            set { bomNum = value; }
        }
        public string BomMaterial
        {
            get { return bomMaterial; }
            set { bomMaterial = value; }
        }
        public string SingleWeight
        {
            get { return singleWeight; }
            set { singleWeight = value; }
        }
        public string TotalWeight
        {
            get { return totalWeight; }
            set { totalWeight = value; }
        }
        public string BomNote
        {
            get { return bomNote; }
            set { bomNote = value; }
        }

    }

}
